package com.sphd.education.base;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.app.Dialog;
import android.graphics.drawable.AnimationDrawable;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.sphd.education.R;

import org.json.JSONArray;
import org.json.JSONObject;

import butterknife.Bind;

/**
 * Created by Administrator on 2015/12/14.
 */
public abstract class BaseFragment extends Fragment {
    private Dialog dialog;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }
    public void showMyDialog() {
        dialog=new Dialog(getContext(), R.style.Translucent_NoTitle);
        dialog.setContentView(R.layout.customprogressdialog);
        dialog.setCanceledOnTouchOutside(false);
        ImageView imageView = (ImageView) dialog.findViewById(R.id.loadingImageView);
        AnimationDrawable spinner = (AnimationDrawable) imageView.getBackground();
        // 开始动画
        spinner.start();
        dialog.show();
    }
    public void dismissMyDialog() {
        dialog.dismiss();
    }

    public abstract void myNet();
    public abstract void getList( String string);
    public abstract void getList( JSONObject jsonObject);
    public abstract void getList( JSONArray jsonArray);



}
